package com.nanshenycd.controller.front;


import com.nanshenycd.service.BlogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
@Api(description  = "跳转归档信息")
public class ArchiveShowController {

    @Autowired
    BlogService blogService;

    @GetMapping("/archives")
    @ApiOperation(value = "跳转归档信息")
    public String archives(Model model){

        model.addAttribute("archiveMap",blogService.archiveBlog());
        model.addAttribute("blogCount",blogService.countBlog());

        return "archives";
    }
}
